home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / hard / galer / source / src.lha / Source / GALer / Checker.c next >
Encoding:
C/C++ Source or Header  |  1993-11-10  |  14.2 KB  |  730 lines

  1. /****************************************************************/
  2. /*                                */
  3. /* Checker - this file includes the GAL-Checker            */
  4. /*                                */
  5. /*                                */
  6. /****************************************************************/
  7.  
  8.  
  9. #include <intuition/intuition.h>
  10. #include <stdio.h>
  11. #include <string.h>
  12.  
  13. #include <proto/locale.h>
  14. #include <proto/graphics.h>
  15. #include <proto/intuition.h>
  16.  
  17. #include "GALer.h"
  18. #include "Localize.h"
  19.  
  20.  
  21.  
  22. extern    struct  AppString { LONG   as_ID;
  23.                  STRPTR as_Str;
  24.               };
  25.  
  26. extern    struct  AppString AppStrings[];
  27.  
  28. extern    int    pruef_mode;
  29. extern    int    gal_type;
  30. extern    int    asmreadyflag;
  31. extern    int    num_of_pins;
  32.  
  33. extern    UBYTE    PinNames[24][10];
  34.  
  35. extern  struct    Window        *window;
  36. extern    struct    RastPort    *rp;
  37. extern    struct    Border        Border1;
  38. extern    struct    Border        Border2;
  39.  
  40. extern    struct    Menu        *mainmenu, *pruefermenu;
  41.  
  42. extern    struct    Gadget        Gadget1;
  43. extern    struct    Gadget        Gadget3;
  44. extern    struct    Gadget        Gadget14;
  45. extern    struct    Gadget        Gadget15;
  46. extern    struct    Gadget        Gadget16;
  47. extern    struct    Gadget        Gadget17;
  48. extern    struct    Gadget        Gadget18;
  49. extern    struct    Gadget        Gadget19;
  50. extern    struct    Gadget        Gadget20;
  51. extern    struct    Gadget        Gadget23;
  52. extern    struct    Gadget        Gadget21;
  53. extern    struct    Gadget        Gadget22;
  54. extern    struct    Gadget        Gadget30;
  55. extern    struct    Gadget        Gadget31;
  56. extern    struct    Gadget        Gadget37;
  57. extern    struct    Gadget        Gadget38;
  58. extern    struct    Gadget        Gadget39;
  59.  
  60.  
  61.  
  62. extern    struct    Catalog        *catalog;
  63.  
  64.  
  65. int    GALType;
  66. int    outIC1, outIC3, outIC4, outIC5;
  67.  
  68.  
  69.  
  70. struct    in_con      { int IC;
  71.             int Bit;
  72.             int IO;
  73.             int Level; };
  74.  
  75. struct    out_con      { int IC;
  76.             int Bit; };
  77.  
  78.  
  79.  
  80. /* in_bit[gadID]
  81.  
  82.  1. entry: IC which controls the pin which has the gadget ID gadID
  83.  2. entry: bit of this IC which controls the pin
  84.  3. entry: shows whether a pin is used as input or output
  85.  4. entry: shows level of this pin
  86. */
  87. struct in_con  in_bit[23] = {
  88.  
  89.         {IC4, 0x01, INPUT_PIN,  LOW},     /* pin  1 */
  90.         {IC4, 0x02, INPUT_PIN,  LOW},     /* pin  2 */
  91.         {IC4, 0x04, INPUT_PIN,  LOW},     /* pin  3 */
  92.         {IC4, 0x08, INPUT_PIN,  LOW},     /* pin  4 */
  93.         {IC4, 0x10, INPUT_PIN,  LOW},     /* pin  5 */
  94.         {IC4, 0x20, INPUT_PIN,  LOW},     /* pin  6 */
  95.         {IC4, 0x40, INPUT_PIN,  LOW},     /* pin  7 */
  96.         {IC4, 0x80, INPUT_PIN,  LOW},     /* pin  8 */
  97.         {IC5, 0x01, INPUT_PIN,  LOW},     /* pin  9 */
  98.         {IC5, 0x02, INPUT_PIN,  LOW},     /* pin 10 */
  99.         {IC5, 0x04, INPUT_PIN,  LOW},     /* pin 11 */
  100.         { 0,   0,      0,        0 },     /*  GND   */
  101.         {IC5, 0x08, INPUT_PIN,  LOW},     /* pin 13 */
  102.         {IC5, 0x10, INPUT_PIN,  LOW},     /* pin 14 */
  103.         {IC5, 0x20, OUTPUT_PIN, LOW},     /* pin 15 */
  104.         {IC3, 0x01, OUTPUT_PIN, LOW},     /* pin 16 */
  105.         {IC3, 0x02, OUTPUT_PIN, LOW},     /* pin 17 */
  106.         {IC3, 0x04, OUTPUT_PIN, LOW},     /* pin 18 */
  107.         {IC3, 0x08, OUTPUT_PIN, LOW},     /* pin 19 */
  108.         {IC3, 0x10, OUTPUT_PIN, LOW},     /* pin 20 */
  109.         {IC3, 0x20, OUTPUT_PIN, LOW},     /* pin 21 */
  110.         {IC3, 0x40, OUTPUT_PIN, LOW},     /* pin 22 */
  111.         {IC3, 0x80, INPUT_PIN,  LOW}      /* pin 23 */
  112.  
  113.                 };
  114.  
  115.  
  116.  
  117. /*  out_bit[gadID - 14]
  118.   1. entry: IC which can read the pin which has the gadget ID gadID
  119.   2. entry: bit of this IC
  120. */
  121. struct out_con out_bit[10] = { { IC7,  0x01 },
  122.                    { IC7,  0x02 },
  123.                    { IC7,  0x04 },
  124.                    { IC7,  0x08 },
  125.                    { IC7,  0x10 },
  126.                    { IC7,  0x20 },
  127.                    { IC7,  0x40 },
  128.                    { IC7,  0x80 },
  129.                    { IC6a, 0x01 },
  130.                    { IC6c, 0x01 } };
  131.  
  132.  
  133.  
  134. /* this array shows which IO-select gadged ID corresponds with which
  135.    level gadget
  136.  
  137.    level_gadget = IOtoLevel[gadID - 30];
  138.  
  139.    gadID: gadget ID of IO-select gadget
  140. */
  141. struct Gadget  *IOtoLevel[] = { &Gadget14,
  142.                 &Gadget15,
  143.                 &Gadget16,
  144.                 &Gadget17,
  145.                 &Gadget18,
  146.                 &Gadget19,
  147.                 &Gadget20,
  148.                 &Gadget21,
  149.                 &Gadget22,
  150.                 &Gadget23 };
  151.  
  152.  
  153.  
  154. void Pruefer(struct Gadget *gad, USHORT gadID)
  155. {
  156. UBYTE    c;
  157.  
  158.   c = (UBYTE)*gad->GadgetText->IText;
  159.                         /*** input gadgets ***/
  160.   if ((gadID >= 1) && (gadID <= 23)) {
  161.     if (gad->GadgetRender != (APTR)&Border2) {    /* output pin? */
  162.       if (c == 'L') {                /* no, then set level */
  163.         c = 'H';
  164.  
  165.         in_bit[gadID - 1].Level = HIGH;
  166.  
  167.         SetLevel(gadID, HIGH);
  168.       }
  169.       else {
  170.         c = 'L';
  171.  
  172.         in_bit[gadID - 1].Level = LOW;
  173.  
  174.         SetLevel(gadID, LOW);
  175.       }
  176.     }
  177.   }
  178.  
  179.                     /*** input/output gadgets (I/O) ***/
  180.   if ((gadID >= 30) && (gadID <= 39)) {
  181.     if (c == 'O') {
  182.       c = 'I';
  183.  
  184.                         /* change color and text*/
  185.       IOtoLevel[gadID - 30]->GadgetRender = (APTR)&Border1;
  186.  
  187.       *IOtoLevel[gadID - 30]->GadgetText->IText = 'L';
  188.  
  189.       SetLevel(gadID - 16, LOW);
  190.  
  191.       in_bit[gadID - 17].IO = INPUT_PIN;
  192.     }
  193.     else {
  194.       c = 'O';
  195.  
  196.       IOtoLevel[gadID-30]->GadgetRender = (APTR)&Border2;
  197.  
  198.       in_bit[gadID-17].IO = OUTPUT_PIN;
  199.  
  200.       SetLevel(gadID-16, LOW);
  201.  
  202.     }
  203.  
  204.     RefreshGList(IOtoLevel[gadID - 30], window, NULL, 1L);
  205.   }
  206.  
  207.   CheckOutput();
  208.  
  209.   *gad->GadgetText->IText = c;
  210.  
  211.   RefreshGList(gad, window, NULL, 1L);
  212. }
  213.  
  214.  
  215.  
  216.  
  217. /* set level (=HIGH or LOW) of the pin which has the gadget ID "gadID"
  218. */
  219. void SetLevel(USHORT gadID, int Level)
  220. {
  221. int    bits, ICnum, outIC;
  222.  
  223.  
  224.   ICnum = in_bit[gadID - 1].IC;            /* get IC number and output */
  225.   bits  = in_bit[gadID - 1].Bit;        /* bit of this IC */
  226.  
  227.  
  228.   if (ICnum == IC3)
  229.     outIC = outIC3;
  230.  
  231.   if (ICnum == IC4)
  232.     outIC = outIC4;
  233.  
  234.   if (ICnum == IC5)
  235.     outIC = outIC5;
  236.  
  237.  
  238.   bits ^= 0xFF;                /* invert all bits */
  239.  
  240.   outIC &= bits;            /* set the output bit of the IC */
  241.   if (Level == HIGH) {
  242.     bits ^= 0xFF;
  243.     outIC |= bits;
  244.   }
  245.  
  246.   WriteByte(outIC, ICnum);        /* set level of pin */
  247.  
  248. }
  249.  
  250.  
  251.  
  252. /* check whether a output is HIGH, LOW or tristate
  253.    Call: the outputs must be switched LOW by use of the 10kOhm resistors
  254. */
  255. void CheckOutput(void)
  256. {
  257. struct    Gadget    *gad;
  258.  
  259. int n, in_bits, out_bits, pin_Level;
  260. int inICnum, outICnum, outIC, byte, first_out, last_out;
  261.  
  262.  
  263.   switch (GALType) {            /* get possible output pins */
  264.     case GAL16V8:
  265.       first_out = 14;
  266.       last_out  = 21;
  267.       break;
  268.  
  269.     case GAL20V8:
  270.       first_out = 15;
  271.       last_out  = 22;
  272.       break;
  273.  
  274.     default:                /* GAL22V10, GAL20RA10 */
  275.       first_out = 14;
  276.       last_out  = 23;
  277.       break;
  278.   }
  279.  
  280.  
  281.   for(n = first_out; n <= last_out; n++) {  /* check all outputs */
  282.  
  283.     if (in_bit[n - 1].IO == OUTPUT_PIN) {
  284.  
  285.       outICnum = in_bit[n - 1].IC;
  286.       out_bits = in_bit[n - 1].Bit;
  287.  
  288.       inICnum  = out_bit[n - 14].IC;
  289.       in_bits  = out_bit[n - 14].Bit;
  290.  
  291.  
  292.       if (outICnum == IC3)
  293.         outIC = outIC3;
  294.  
  295.       if (outICnum == IC4)
  296.         outIC = outIC4;
  297.  
  298.       if (outICnum == IC5)
  299.         outIC = outIC5;
  300.  
  301.  
  302.       byte = ReadByte(inICnum);        /* get level of outputs */
  303.  
  304.       if (byte & in_bits)
  305.         pin_Level = HIGH;        /* "calculate" level of outputs */
  306.       else
  307.         pin_Level = LOW;
  308.  
  309.       outIC |= out_bits;        /* set output HIGH */
  310.       WriteByte(outIC, outICnum);
  311.  
  312.       byte = ReadByte(inICnum);        /* get level of outputs */
  313.  
  314.  
  315.       gad = IOtoLevel[n - 14];
  316.  
  317.       if (pin_Level != (1&&(byte & in_bits))) {    /*Ausgang widerspricht nicht->Z*/
  318.         *gad->GadgetText->IText = 'Z';
  319.  
  320.         RefreshGList(gad, window, NULL, 1L);
  321.       }
  322.       else {
  323.     if (pin_Level == LOW)
  324.       *gad->GadgetText->IText = 'L';
  325.     else
  326.           *gad->GadgetText->IText = 'H';
  327.  
  328.     RefreshGList(gad, window, NULL, 1L);
  329.       }
  330.  
  331.       outIC &= (out_bits^0xFF);            /* switch output LOW again */
  332.       WriteByte(outIC, outICnum);
  333.     }
  334.   }
  335. }
  336.  
  337.  
  338.  
  339.  
  340. /* switch checker on/off
  341. */
  342. void TogglePruefer(void)
  343. {
  344. int    n;
  345. struct    Gadget    *gad;
  346.  
  347.  
  348.   if (pruef_mode) {
  349.     LED(OFF);
  350.     DisableVcc();
  351.  
  352.     pruef_mode = OFF;                /* exit checker*/
  353.  
  354.     gad = &Gadget3;                /* init. text of gadgets */
  355.  
  356.     while(gad != NULL) {
  357.       if (*gad->GadgetText->IText == 'I')
  358.         *gad->GadgetText->IText = 'O';
  359.  
  360.       if (*gad->GadgetText->IText == 'H')
  361.         *gad->GadgetText->IText = 'L';
  362.  
  363.       if (*gad->GadgetText->IText == 'Z')
  364.         *gad->GadgetText->IText = 'L';
  365.  
  366.       gad = gad->NextGadget;
  367.     }
  368.   
  369.  
  370.     gad = &Gadget14;
  371.  
  372.     for (n = 0; n < 10; n++) {            /* reset color of possible */
  373.                             /* outputs (Gadget14..23)  */
  374.       if (GALType == GAL22V10 || GALType == GAL20RA10)
  375.         gad->GadgetRender = &Border2;
  376.  
  377.       if (GALType == GAL20V8)
  378.         if (n == 0 || n == 9)
  379.       gad->GadgetRender = &Border1;
  380.         else    
  381.           gad->GadgetRender = &Border2;
  382.  
  383.       if (GALType == GAL16V8)
  384.         if (n == 8 || n == 9)
  385.       gad->GadgetRender = &Border1;
  386.         else    
  387.           gad->GadgetRender = &Border2;
  388.  
  389.       gad = gad->NextGadget;
  390.     }
  391.  
  392.  
  393.     RefreshGList(&Gadget3, window, NULL, -1L);
  394.  
  395.     MyRequest(INFO_REQ, AppStrings[MSG_REMOVE_GAL].as_Str);
  396.  
  397.     ClearMenuStrip(window);
  398.  
  399.     SetMenuStrip(window, mainmenu);
  400.  
  401.   }
  402.   else {
  403.     if (MyRequest(GALTYPE_REQ, AppStrings[MSG_GAL_CHECKER].as_Str)) {
  404.  
  405.                     /* initialize in_bit array */
  406.       for (n = 0; n < 23; n++) {
  407.         in_bit[n].Level = LOW;
  408.     in_bit[n].IO    = INPUT_PIN;
  409.       }
  410.  
  411.       in_bit[14].IO = OUTPUT_PIN;    /* pins 15 to 21 can always */
  412.       in_bit[15].IO = OUTPUT_PIN;    /* be outputs */
  413.       in_bit[16].IO = OUTPUT_PIN;
  414.       in_bit[17].IO = OUTPUT_PIN;
  415.       in_bit[18].IO = OUTPUT_PIN;
  416.       in_bit[19].IO = OUTPUT_PIN;
  417.       in_bit[20].IO = OUTPUT_PIN;
  418.  
  419.       if (GALType == GAL22V10 || GALType == GAL20RA10) {
  420.     in_bit[13].IO = OUTPUT_PIN;
  421.     in_bit[21].IO = OUTPUT_PIN;
  422.     in_bit[22].IO = OUTPUT_PIN;
  423.       }
  424.  
  425.       if (GALType == GAL16V8)
  426.     in_bit[13].IO = OUTPUT_PIN;
  427.  
  428.       if (GALType == GAL20V8)
  429.     in_bit[21].IO = OUTPUT_PIN;
  430.  
  431.  
  432.  
  433.       LED(ON);
  434.  
  435.       EnableVcc();
  436.  
  437.       pruef_mode = ON;                /* init. checker */
  438.  
  439.       WaitForTimer(100000L);
  440.  
  441.       CheckOutput();                /* test outputs */
  442.  
  443.       ClearMenuStrip(window);
  444.  
  445.       SetMenuStrip(window, pruefermenu);
  446.     }
  447.   }
  448. }
  449.  
  450.  
  451.  
  452.  
  453. /* draw GAL
  454. */
  455. void DrawGAL(int type)
  456. {
  457. int    pins, n;
  458. long    ypos, ic_hight;
  459. char    pinnum[2];                /* pin number as ASCII text */
  460. struct    Gadget    *gad;
  461.  
  462.  
  463.  
  464.   ClearPinNames();
  465.  
  466.  
  467.   RemoveGList(window, &Gadget3, -1L);        /* remove all gadgets from */
  468.                         /* the symbolic GAL */
  469.  
  470.   Gadget21.NextGadget = NULL;            /* reset the lists of gadget */
  471.   Gadget37.NextGadget = NULL;            /* look at GALer.c for a */
  472.   Gadget38.NextGadget = NULL;            /* short description on */
  473.   Gadget1.NextGadget = NULL;            /* the gadget lists */
  474.   
  475.  
  476.   SetAPen(rp, 0L);                /* clear screen */
  477.   RectFill(rp, 240L, 16L, 400L, 140L);
  478.   SetAPen(rp, 1L);
  479.  
  480.  
  481.  
  482.   if (type == GAL16V8) {        /*** GAL16V8 ***/
  483.     Gadget21.NextGadget = &Gadget30;
  484.     pins = 20;
  485.  
  486.     ypos = 40L;
  487.  
  488.     ic_hight = 100L;
  489.   }
  490.  
  491.  
  492.  
  493.   if (type == GAL20V8) {        /*** GAL20V8 ***/
  494.     Gadget21.NextGadget = &Gadget22;        /* join list of gadgets for */
  495.     Gadget1.NextGadget  = &Gadget31;        /* 20V8 GALs */
  496.     Gadget37.NextGadget = &Gadget38;
  497.  
  498.     pins = 24;
  499.  
  500.     ypos = 20L;
  501.  
  502.     ic_hight = 120L;
  503.   }
  504.  
  505.  
  506.                     /*** GAL22V10, GAL20RA10 ***/
  507.   if (type == GAL22V10 || type == GAL20RA10) {
  508.     Gadget21.NextGadget = &Gadget22;        /* join list of gadgets for */
  509.     Gadget1.NextGadget  = &Gadget30;        /* 22V10 and 20RA10 GALs */
  510.     Gadget37.NextGadget = &Gadget38;
  511.     Gadget38.NextGadget = &Gadget39;
  512.  
  513.     pins = 24;
  514.  
  515.     ypos = 20L;
  516.  
  517.     ic_hight = 120L;
  518.   }
  519.  
  520.  
  521.   gad = &Gadget14;
  522.  
  523.   for (n = 0; n < 10; n++) {            /* reset color of possible */
  524.                             /* outputs (Gadget14..23)  */
  525.     if (GALType == GAL22V10 || GALType == GAL20RA10)
  526.       gad->GadgetRender = &Border2;
  527.  
  528.     if (GALType == GAL20V8)
  529.       if (n == 0 || n == 9)
  530.     gad->GadgetRender = &Border1;
  531.       else    
  532.         gad->GadgetRender = &Border2;
  533.  
  534.     if (GALType == GAL16V8)
  535.       if (n == 8 || n == 9)
  536.     gad->GadgetRender = &Border1;
  537.       else    
  538.         gad->GadgetRender = &Border2;
  539.  
  540.     gad = gad->NextGadget;
  541.   }
  542.  
  543.  
  544.                         /* add gadgets to window */
  545.  
  546.   AddGList(window, &Gadget3, -1, -1, NULL);
  547.  
  548.   RefreshGadgets(&Gadget3, window, NULL);
  549.  
  550.  
  551.   Move(rp, 280L, ypos-2L);            /* draw GAL */
  552.   Draw(rp, 360L, ypos-2L);
  553.   Draw(rp, 360L, ypos+ic_hight);
  554.   Draw(rp, 280L, ypos+ic_hight);
  555.   Draw(rp, 280L, ypos-2L);
  556.  
  557.   Move(rp, 312L, ypos-2L);            /* draw mark */
  558.   Draw(rp, 312L, ypos+3L);
  559.   Draw(rp, 326L, ypos+3L);
  560.   Draw(rp, 326L, ypos-2L);
  561.  
  562.  
  563.   SetDrMd(rp, (long)JAM1);            /* draw pins */
  564.  
  565.   for (n = 1; n <= pins; n++) {
  566.     sprintf(&pinnum[0], "%2d", n);
  567.  
  568.     if (n < pins/2) {
  569.       DrawLeftPin(280L, ypos);
  570.  
  571.       Move(rp, 264L, ypos+7L);
  572.  
  573.       Text(rp, (char *)pinnum, 2L);
  574.  
  575.       Move(rp, 285L, ypos+7L);
  576.  
  577.       Text(rp, (char *)"I", 1L);
  578.  
  579.       ypos += 10L;
  580.     }
  581.  
  582.     if (n == pins/2) {
  583.       DrawLeftPin(280L, ypos);
  584.  
  585.       Move(rp, 264L, ypos+7L);
  586.  
  587.       Text(rp, (char *)pinnum, 2L);
  588.     }
  589.  
  590.     if (n > pins/2) {
  591.       DrawRightPin(360L, ypos);
  592.  
  593.       Move(rp, 361L, ypos+7L);
  594.  
  595.       Text(rp,(char *)pinnum,2L);
  596.  
  597.       if (n == pins/2+1) {
  598.         Move(rp, 348L, ypos+7L);
  599.  
  600.         Text(rp, (char *)"I", 1L);
  601.       }
  602.  
  603.       if ((n == 14) && (GALType == GAL20V8)) {
  604.         Move(rp, 348L, ypos+7L);
  605.  
  606.         Text(rp, (char *)"I", 1L);
  607.       }
  608.  
  609.       if ((n == 23) && (GALType == GAL20V8)) {
  610.         Move(rp, 348L, ypos+7L);
  611.         Text(rp, (char *)"I", 1L);
  612.       }
  613.  
  614.       ypos -= 10L;
  615.     }
  616.   }
  617.  
  618.   SetDrMd(rp, (long)JAM2);
  619.  
  620. }
  621.  
  622.  
  623.  
  624. /* draw the left pins of the symbolic GAL
  625. */
  626. void DrawLeftPin(long x, long y)
  627. {
  628.   Move(rp, x, y);
  629.  
  630.   Draw(rp, x - 18L, y);
  631.  
  632.   Draw(rp, x - 18L, y + 8L);
  633.  
  634.   Draw(rp, x, y + 8L);
  635. }
  636.  
  637.  
  638.  
  639. /* draw the right pins of the symbolic GAL
  640. */
  641. void DrawRightPin(long x, long y)
  642. {
  643.   Move(rp, x, y);
  644.  
  645.   Draw(rp, x + 18L, y);
  646.  
  647.   Draw(rp, x + 18L, y + 8L);
  648.  
  649.   Draw(rp, x, y + 8L);
  650. }
  651.  
  652.  
  653.  
  654.  
  655.  
  656. /* set pin names at the symbolic GAL
  657. */
  658. void PrintPinNames(void)
  659. {
  660. int    n;
  661. long    ypos;
  662.  
  663.  if (asmreadyflag) {                /*is there a assembled file?*/
  664.    if (gal_type == GALType) {            /*is type of GAL o.k.?*/
  665.      ClearPinNames();
  666.      if (GALType == GAL16V8)
  667.        ypos = 40L;
  668.      else
  669.        ypos = 20L;
  670.  
  671.      for (n = 1; n <= num_of_pins; n++) {
  672.        if (n < num_of_pins/2) {
  673.      Move(rp, 234L-8L*(long)strlen((char *)&PinNames[n-1][0]), ypos+7L);
  674.      ypos += 10;
  675.        }
  676.  
  677.        if (n == num_of_pins/2) {
  678.      Move(rp, 234L-8L*(long)strlen((char *)&PinNames[n-1][0]), ypos+7L);
  679.        }
  680.  
  681.        if (n > num_of_pins/2) {
  682.      Move(rp, 406L, ypos+7L);
  683.       ypos -= 10;
  684.        }
  685.  
  686.        Text(rp, (char *)&PinNames[n-1][0], (long)strlen((char *)&PinNames[n-1][0]));
  687.      }
  688.  
  689.     }
  690.    else {
  691.      ErrorReq(9);                /* wrong GAL selected */
  692.    }
  693.  
  694.  }
  695.  else {
  696.    ErrorReq(7);                    /* no names to print*/
  697.  }
  698.  
  699. }
  700.  
  701.  
  702.  
  703. /* clear the pin names at the symbolic GAL
  704. */
  705. void ClearPinNames(void)
  706. {
  707. int    n;
  708. long    ypos;
  709.  
  710.  ypos = 20L;
  711.  
  712.  for (n = 1; n <= 24; n++) {
  713.    if (n < 24/2) {
  714.      Move(rp, 154L, ypos+7L);
  715.  
  716.      ypos += 10;
  717.    }
  718.  
  719.    if (n == 24/2)
  720.      Move(rp, 154L, ypos+7L);
  721.  
  722.    if (n > 24/2) {
  723.      Move(rp, 406L, ypos+7L);
  724.      ypos -= 10;
  725.    }
  726.    Text(rp,(char *)"          ", 10L);
  727.  }
  728. }
  729.  
  730.